package com.jiankang.controller;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jiankang.entity.Onlinebooking;
import com.jiankang.entity.Version;
import com.jiankang.service.OnlinebookingService;
import com.jiankang.service.VersionService;
@Controller
@RequestMapping("/version")
public class VersionController {
	@Resource
	private VersionService versionService;
	@RequestMapping("/selectversion") 
	public String selectversion(Model model){
		List<Version> sion=versionService.selectversion();
		model.addAttribute("sion",sion);
		return "admin/sion";
	}
	@RequestMapping("/software/{id}")
	public String software(@PathVariable("id") int id,Model model,Version version){
		version=versionService.formationdetails(id);
		model.addAttribute("version",version);
		return "admin/software";
	}
	
	
	
	
	
	
	
	
	
	
	
	
	@Resource
	private OnlinebookingService onlinebookingService; 
	@RequestMapping("/selectverbooking") 
	public String selectverbooking(Model model){
		List<Onlinebooking> onlinebooking=onlinebookingService.selectverbooking();
		model.addAttribute("onlinebooking",onlinebooking);
		return "admin/onlinebooking";
	}
	@RequestMapping(value = "/modifiedprofile/{id}")
	public String editupdate(@PathVariable("id") int id,Model model,Onlinebooking onlinebooking) {
		onlinebooking=onlinebookingService.formationdetails(id);
		model.addAttribute("onlinebooking", onlinebooking);
		return "admin/modifiedprofile";
	}
}
